@extends('layout.master')

@section('title','发送帖子')

@section('css')
    @parent
    <link href="{{ asset('plugins/bower_components/summernote/dist/summernote.css') }}" rel="stylesheet"/>
    <!-- animation CSS -->
    <link href="{{ asset('css/animate.css') }}" rel="stylesheet">
    <link href="{{ asset('plugins/bower_components/icheck/skins/all.css') }}" rel="stylesheet">
    <link href="{{ asset('plugins/bower_components/bootstrap-switch/bootstrap-switch.min.css') }}" rel="stylesheet">
@endsection
@section('main')
    @if (session('message'))
        <div>
            <input type="hidden" id="hidden" name="hidden" value="hidden">
            <input type="hidden" id="message" name="message" value="{{ session('message') }}">
            <input type="hidden" id="status" name="status" value="{{ session('status') }}">
        </div>
    @endif
    <div class="row">
        <div class="col-lg-12 col-md-12">
            <div class="white-box">
                <form class="form-horizontal form-material" method="post" id="tiezi"
                      enctype="multipart/form-data">
                <div class="row">
                    {{--<div class="col-lg-4 col-md-4">--}}
                        {{--<label class="control-label">分类</label>--}}
                        {{--<div class="example">--}}
                            {{--<select style="height: 38px" name="ctype">--}}
                                {{--@foreach(App\Postings::$TypeDisplay as $value)--}}
                                    {{--<option value="{{ $value }}">{{ $value }}</option>--}}
                                {{--@endforeach--}}
                            {{--</select>--}}
                        {{--</div>--}}
                    {{--</div>--}}
                    {{--<div class="col-lg-4 col-md-4">--}}
                        {{--<label class="control-label">城市</label>--}}
                        {{--<div class="example">--}}
                            {{--<select style="height: 38px" name="city">--}}
                                {{--@foreach(App\Postings::$CityDisplay as $value)--}}
                                    {{--<option value="{{ $value }}">{{ $value }}</option>--}}
                                {{--@endforeach--}}
                            {{--</select>--}}
                        {{--</div>--}}
                    {{--</div>--}}
                    <div class="col-lg-4 col-md-4">
                        <label class="control-label">选择用户</label>
                        <div class="example">
                            <select style="height: 38px" name="user_id">
                                @foreach(App\User::PostingsUsers() as $value)
                                    <option value="{{ $value->c_id }}">{{ $value->name }}</option>
                                @endforeach
                            </select>
                        </div>
                    </div>
                    <div class="col-md-3 col-sm-6">
                        <div class="form-group">
                            <label class="col-md-12">标题</label>
                            <div class="col-md-12">
                                <input type="text" name="title"
                                       class="form-control form-control-line">
                            </div>
                        </div>
                    </div>
                    <div class="col-lg-4 col-md-4">
                        <label class="control-label">科室</label>
                        <div class="example">
                            <select style="height: 38px" name="keshi_id">
                                @foreach(App\Keshi::Keshis() as $value)
                                    <option value="{{ $value->id }}">{{ $value->title }}</option>
                                @endforeach
                            </select>
                        </div>
                    </div>
                    <div class="col-lg-4 col-md-4">
                        <label class="control-label">话题</label>
                        <div class="example">
                            <select style="height: 38px" name="huati_id">
                                <option value="">无</option>
                                @foreach(App\Huati::Huatis() as $value)
                                    <option value="{{ $value->id }}">{{ $value->title }}</option>
                                @endforeach
                            </select>
                        </div>
                    </div>
                </div>
                    <div class="row">
                        <div class="col-sm-12">
                            <textarea style="height: 150px; width: 100%;overflow:auto;"name="contents" id="contents"></textarea>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-lg-2 col-md-2">
                            <div class="row">
                                <label class="control-label">图片/视频</label>
                            </div>
                            <div class="row">
                                <div class="radio radio-purple">
                                    <input type="radio" name="porm" checked id="pic" value="1">
                                    <label for="radio8"> 图片 </label>
                                </div>
                            </div>
                            <div class="row">
                                <div class="radio radio-purple">
                                    <input type="radio" name="porm" id="video" value="2">
                                    <label for="radio8"> 视频 </label>
                                </div>
                            </div>
                        </div>
                        <div class="col-lg-9 col-md-9">
                            <div class="row">
                                <div class="col-lg-4 col-md-4" id="">
                                    <div class="form-group ">
                                        <input type="file" id="input-file-now-custom-1 file1" class="dropify" name="file1"
                                               data-height="100px"
                                               data-default-file=""/>
                                    </div>
                                </div>
                                <div class="col-lg-4 col-md-4" id="file2">
                                    <div class="form-group ">
                                        <input type="file" id="input-file-now-custom-2" class="dropify" name="file2"
                                               data-height="100px"
                                               data-default-file=""/>
                                    </div>
                                </div>
                                <div class="col-lg-4 col-md-4" id="file3">
                                    <div class="form-group ">
                                        <input type="file" id="input-file-now-custom-3" class="dropify" name="file3"
                                               data-height="100px"
                                               data-default-file=""/>
                                    </div>
                                </div>
                                <div class="col-lg-4 col-md-4" id="file4">
                                    <div class="form-group ">
                                        <input type="file" id="input-file-now-custom-4" class="dropify" name="file4"
                                               data-height="100px"
                                               data-default-file=""/>
                                    </div>
                                </div>
                                <div class="col-lg-4 col-md-4" id="file5">
                                    <div class="form-group ">
                                        <input type="file" id="input-file-now-custom-5" class="dropify" name="file5"
                                               data-height="100px"
                                               data-default-file=""/>
                                    </div>
                                </div>
                                <div class="col-lg-4 col-md-4" id="file6">
                                    <div class="form-group ">
                                        <input type="file" id="input-file-now-custom-6" class="dropify" name="file6"
                                               data-height="100px"
                                               data-default-file=""/>
                                    </div>
                                </div>
                                <div class="col-lg-4 col-md-4" id="file7">
                                    <div class="form-group ">
                                        <input type="file" id="input-file-now-custom-7" class="dropify" name="file7"
                                               data-height="100px"
                                               data-default-file=""/>
                                    </div>
                                </div>
                                <div class="col-lg-4 col-md-4" id="file8">
                                    <div class="form-group ">
                                        <input type="file" id="input-file-now-custom-8" class="dropify" name="file8"
                                               data-height="100px"
                                               data-default-file=""/>
                                    </div>
                                </div>
                                <div class="col-lg-4 col-md-4" id="file9">
                                    <div class="form-group ">
                                        <input type="file" id="input-file-now-custom-9" class="dropify" name="file9"
                                               data-height="100px"
                                               data-default-file=""/>
                                    </div>
                                </div>
                            </div>
                        </div>

                    </div>
                    <div class="form-group">
                        <div class="row">
                            <button class="fcbtn btn btn-success btn-outline btn-1e waves-effect">发帖
                            </button>
                            {!! csrf_field() !!}
                        </div>
                    </div>

                </form>
            </div>
        </div>
    </div>
@endsection
@section('js')
    @parent
    <!-- icheck -->
    <script src="{{ asset('plugins/bower_components/icheck/icheck.min.js') }}"></script>
    <script src="{{ asset('plugins/bower_components/icheck/icheck.init.js') }}"></script>
    <script src="{{ asset('js/jasny-bootstrap.js') }}"></script>
    <!-- jQuery file upload -->
    <script src="{{ asset('plugins/bower_components/dropify/dist/js/dropify.min.js') }}"></script>
    <script>
        $(document).ready(function () {
            // Basic
            $('.dropify').dropify();
        });
    </script>
    <script src="{{ asset('plugins/bower_components/bootstrap-select/bootstrap-select.min.js') }}"
            type="text/javascript"></script>
    <!-- bt-switch -->
    <script src="{{ asset('plugins/bower_components/bootstrap-switch/bootstrap-switch.min.js') }}"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            var hidden = $('#hidden').val();
            if (hidden === 'hidden') {
                if ($('#status').val() == 1) {
                    toastsuccess($('#message').val());
                } else {
                    toasterror($('#message').val());
                }
            }
        });

        $('#pic').click(function () {
            $('#file2').show();
            $('#file3').show();
            $('#file4').show();
            $('#file5').show();
            $('#file6').show();
            $('#file7').show();
            $('#file8').show();
            $('#file9').show();
        });

        $('#video').click(function () {
            $('#file2').hide();
            $('#file3').hide();
            $('#file4').hide();
            $('#file5').hide();
            $('#file6').hide();
            $('#file7').hide();
            $('#file8').hide();
            $('#file9').hide();
        });

    </script>
@endsection